package com.checker.Utils;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ArrayUtil;

import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

public class MapUtils {

    public static <K, V> void prettyPrint(Map<K, V> map) {
        if (map == null || map.isEmpty()) {
            return;
        }
        final Set<Map.Entry<K, V>> entries = map.entrySet();
        for (Map.Entry<K, V> entry : entries) {
            final K key = entry.getKey();
            final V value = entry.getValue();
            if (value.getClass().isArray()) {
                System.out.println("Key in Map-->" + key + ",value-->" + ArrayUtil.toString(value));
            } else {
                System.out.println("Key in Map-->" + key + ",value-->" + value);
            }

        }
    }

}
